<!DOCTYPE html>
<html lang="zh-CN">
    <#assign html_title="搬砖之家|新用户注册">
    <head>
        <#include "/components/head.htm"   />
    </head>
<body>
<div id="fullPage">
    <!--Page One-->
    <#include "/components/header.section.htm"   />

    <section>
        <div class="container white-block">
            <h2 class="form-signin-heading">&nbsp;</h2>
            <div class="row">
                <div class="col-sm-2">
                </div>
                <div class="col-sm-8">

                    <form class="form-horizontal" >

                        <div class="form-group">
                            <label  class="col-sm-3 control-label">手机号码 *</label>
                            <div class="col-sm-6">
                                <input class="form-control"  placeholder="手机号码" name="phone">
                            </div>
                        </div>
                        <div class="form-group">
                            <label  class="col-sm-3 control-label">输入密码 *</label>
                            <div class="col-sm-6">
                                <input type="password" class="form-control" placeholder="密码" name="password">
                            </div>
                        </div>
                        <div class="form-group">
                            <label  class="col-sm-3 control-label">再次输入密码 *</label>
                            <div class="col-sm-6">
                                <input type="password" class="form-control"  placeholder="密码" name="password2">
                            </div>
                        </div>
                        <div class="form-group">
                            <label  class="col-sm-3 control-label">昵称</label>
                            <div class="col-sm-6">
                                <input class="form-control"  placeholder="昵称" name="nick_name">
                            </div>
                        </div>
                        <div class="form-group">
                            <label  class="col-sm-3 control-label">电子邮箱</label>
                            <div class="col-sm-6">
                                <input type="email" class="form-control"  placeholder="电子邮箱" name="mail">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-6">
                                <button id="reg" class="btn btn-lg btn-primary btn-block reg-btn" type="button">提交注册</button>
                            </div>
                        </div>

                    </form>

                </div> <!-- /container -->


            </div>
            <h2 class="form-signin-heading">&nbsp;</h2>
        </div>
    </section>
</div>

</body>
<script>
    $(document).ready(function () {
        $("#reg").click(function () {
            $.ajax({
                method:'post',
                url:'/api/user/register',
                data:$('form').serialize(),
                success:function (response) {
                    alert(response.message);
                    if(response.success){
                        window.location.href="/view/user/login";
                    }
                }
            })
        })
    });
</script>
</html>